home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Information
/
THINK C Digest
/
1990
/
90-08
< prev
next >
Wrap
Text File
|
1995-12-31
|
18KB
|
573 lines
Path: ucivax!gateway
From: resnick@kant.cogsci.uiuc.edu (Pete Resnick)
Subject: ShowINIT in THINK C
Message-ID: <9008020332.AA12374@kant.cogsci.uiuc.edu>
X-Mailer: ELM [version 2.2 PL0]
Newsgroups: fa.think-c
Lines: 32
Date: 2 Aug 90 03:32:10 GMT
I am having some trouble using ShowINIT in THINK C. I downloaded
the stuff from info-mac at sumex-aim, I used oConv on the ShowINIT.a.o
file, I added it to my project, and have the following code:
#include <SetUpA4.h>
main()
{
OSErr errCode;
RememberA0();
SetUpA4();
errCode = DoMyINIT();
if(errCode)
SHOWINIT(-4065, 0);
else
SHOWINIT(-4064, 0);
RestoreA4();
}
The -4065 ICN# is the one with the big X through it. I get through my
code and errCode = noErr, and I even get into ShowINIT (I looked in
Macsbug), but then ShowINIT fails (i.e. does a _SysBeep and exits).
Anyone got a clue or example code?
pr
--
Pete Resnick (...so what is a mojo, and why would one be rising?)
Graduate assistant - Philosophy Department, Gregory Hall, UIUC
System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet/ARPAnet/EDUnet : resnick@kant.cogsci.uiuc.edu
BITNET (if no other way) : FREE0285@UIUCVMD
Path: ucivax!gateway
From: Paul_Davis@beach.sics.bu.oz.au (Paul Davis)
Subject: Extended arrays in objects
Message-ID: <9008020046.15999@munnari.oz.au>
X-Mailer: QuickMail/SMTP interface.
Newsgroups: fa.think-c
Lines: 51
Date: 2 Aug 90 09:21:13 GMT
I'm having some trouble using an object defined like this:
struct myObject:CObject {
extended Values[2];
};
myObject *
ImyObject(
void )
{
Values[0] = (extended)0;
Values[1] = (extended)0;
Values[2] = (extended)0;
}
The last assignment always clobbers memory, hangs the machine (even MacsBug)
and forces a reboot. Having three separate extended values ie:
struct myObject:CObject {
extended Value0;
extended Value1;
extended Value2;
};
myObject *
ImyObject(
void )
{
Value0 = (extended)0;
Value1 = (extended)0;
Value2 = (extended)0;
}
doesn't have any problem, so this is the solution I am using for the present.
I prefer the array setup as it enables me to iterate through the values. Is
there any reason why an object shouldn't be able to have an array as an
instance variable? Is there a dereferencing problem in the above IRoutine?
Does THINK warn against this (I haven't found any)?
Thanks for any help in advance.
Paul Davis paul@surf.sics.bu.oz.au
P.O. Box 65
School of Business (075) 952-291 fax: 953-320
Bond University
QLD 4229 Australia
Path: ucivax!gateway
From: Florman@dsg.csc.ti.COM (Bruce)
Subject: Preprocessor symbols
Message-ID: <2858693149-5028619@PCAI>
Newsgroups: fa.think-c
Lines: 30
Date: 3 Aug 90 17:51:37 GMT
Hello all,
Can anyone tell me if THINK_C is the only predefined preprocessor symbol
in Think C? That's the only one that I can find documented, and a
simple test of some other symbols that I would expect to be defined
turned up nothing.
In contrast, MPW C, in addition to defining the symbol applec, also
defines the symbols MC68000, mc68000, m68k and macintosh, and when the
compiler is invoked with the -mc68881 command line option, it also
defines the symbol mc68881.
Of course I can cause all those fixed symbols to be defined by doing
something like the following:
#ifdef THINK_C
#define mc68000
#define macintosh
/* etc. */
#endif THINK_C
However, what I'd really like to be able to get is the code generation
options that the programmer has selected. In particular, I'd like to be
able to do conditional compilations based on whether the "Macsbug
Symbols", "68020" and/or "68881" options have been selected. Does
anybody know of a way to do this?
Cheers,
Bruce Florman
florman@itg.ti.com
Path: ucivax!gateway
From: microsoft!t-alexc@beaver.cs.washington.edu
Subject: Request membership
Message-ID: <9008061844.AA11326@beaver.cs.washington.edu>
Newsgroups: fa.think-c
Lines: 13
Date: 6 Aug 90 21:33:30 GMT
Please add me to the Think C mailing list. (I hope this msg doesn't
get distributed to everybody on it...)
chaffee@reed.bitnet
or chaffee@reed.uucp
--
/---------------------------------\
| Alex Chaffee \-------------------------------\
| Now: Fall: |
| ...!uw-beaver!microsoft!t-alexc chaffee@reed.{uucp.bitnet} |
\------------------------------------------------------------------/
Path: ucivax!gateway
From: KPURCELL@liverpool.ac.UK (Kevin ^G Purcell)
Subject: Buggy updater for Think C 4.0.2 posted to sumex?
Message-ID: <9008070406.aa03961@ICS.UCI.EDU>
Newsgroups: fa.think-c
Lines: 17
Date: 7 Aug 90 11:07:34 GMT
I have wasted a bunch of time today trying to update a copy of Think C 4.0
to 4.0.2, but everytime I use AutoWeave I get a dumb error message, something
like '$OUPUT directory already in use" or something similar. AW also seemed
to prompt me for the same information a couple of times (asking for the
same folder twice in a row) -- is this just crappy interface design or is
there a problem with the copy I have, or (perish the thought :-) I am doing
something stupid?
I saw a note this afternoon on comp.sys.hypercard that somebody else was having
a similar problem.
Any ideas -- please mail direct.
Kevin ^G Purcell ....................... Comments? Questions? Flames? Applause?
\ Surface Science \ Waiter,Waiter,
\ Liverpool University \ There's a bug in my soup.......
\ Liverpool L69 3BX \ ....No Sir! Thats not a bug it's a feature... :-)
Path: ucivax!gateway
From: nagel@ICS.UCI.EDU (Mark Nagel)
Subject: ARCHIVE: GNUucp 2.6
Message-ID: <14933.650052749@ics.uci.edu>
Newsgroups: fa.think-c
Reply-To: nagel@ICS.UCI.EDU
Organization: University of California, Irvine - Dept of ICS
Lines: 41
Date: 7 Aug 90 18:16:18 GMT
Phone: (714) 856-5039
Both the executable and source (in THINK C, so there's the somewhat
tenous connection :) of GNUucp 2.6 has been added to the archive.
Here's the submitter's description:
/*****************************************************************************/
From: jim@fpr.COM, "James E. O'Dell"@ICS.UCI.EDU
Date: 08 May 90 00:00:00 PST
Mac/gnuucp 2.6
Mac/gnuucp is a port of the Free Software Foundations GNUUCP to the
Macintosh. As with all of the Free Software Foundation code, complete source
code is available and will be posted to the net soon.
Mac/gnuucp actually consists of two separate pieces a Hypercard card
through whcih mail is read and sent and the communications program
itself. The program has successfully communicated with Suns, DEC
Vaxes running, COMPAQ 386s and remote copies of itself.
In addition to standard Unix UUCP compatibility the program supports
mailing lists, called aliases and customization through a gnuucp.ctl file.
Mail is delivered to users by writing the mail to a standard
Macintosh file. Because of this, a group of users on almost any type
of Appletalk network can use the program to send mail locally and to
the internet.
A complete manual is included along with instructions for registering your
Mac on the internet and for obtaining a domain name. Information is also
included on finding a "Well Connected" internet host.
Questions or inquiries to: jim@fpr.com
/*****************************************************************************/
[saved as: /mac/think-c/programs/gnuucp-2.6.hqx
/mac/think-c/programs/gnuucp-source-2.6.hqx]
Mark
Path: ucivax!gateway
From: ephraim@Think.COM
Subject: User Interface code from Disinfectant 2.0
Message-ID: <9008131456.AA04013@leander.think.com>
Newsgroups: fa.think-c
Lines: 14
Date: 13 Aug 90 14:56:13 GMT
John Norstad has published the user interface code from Disinfectant
2.0, and I've ported it from MPW to Think C 4.02. This is a minimal
port - I've made no attempt to use Think C's object-oriented features
even though the code cries out for them. Testing, too, has been
minimal due to lack of time.
If you'd like to beta-test this package, it's available for anonymous
ftp from think.com in /public/disinfectant/sample-beta-1.sit.hqx.
Please send comments and suggestions to me (ephraim@think.com) and not
to the full list. I'll summarize to the list as needed.
Ephraim Vishniac
ephraim@think.com
Path: ucivax!gateway
From: bosborne@gn.ecn.purdue.edu (Bradley A Osborne)
Subject: Set Startup ...
Message-ID: <9008142207.AA14083@gn.ecn.purdue.edu>
Newsgroups: fa.think-c
Lines: 29
Date: 14 Aug 90 22:06:30 GMT
I submitted this to comp.sys.mac.programmer, but did not get any response, so
please bear with me if you've seen this before.
You all know how to set an application to open at startup time by using the
Set Startup ... command from the finder; I've found this to be useful by
setting a Red Ryder procedure to be opened at startup to dial up and log
me on to this unix account. However, I don't want this to happen every time
that I start the mac.
What I need to know is: is it possible to write an init that would nuke the
Set Startup application if say, the shift key (for example) is being held down
when the init executes. I've read IM IV and V, but the information there is
just a bit too vague. Do any of you have any information or useful code
snippets that would point me in the right direction?
The way that I think might work is by finding where in memory the startup
app is stored (it's read in before inits are executed c.f. IM V), and setting
it to be NULL (or the Finder?)
Anyway, sorry for the rambling ... If anyone can help, please E-Mail or reply
through this mailing list.
Thanks so much ...
BTW: if anyone saw my original posting on c.s.m.programmer, drop me some
E-Mail so that I know my article made it through. Thanks.
Path: ucivax!gateway
From: bosborne@gn.ecn.purdue.edu (Bradley A Osborne)
Subject: RE:Set Startup
Message-ID: <9008152243.AA29339@gn.ecn.purdue.edu>
Newsgroups: fa.think-c
Lines: 8
Date: 15 Aug 90 22:43:34 GMT
Thanks to all who replied so quickly to my message about how to nuke the set
startup app. The general consensus seems to be to write a short app that
checks for the shift key, and if it is down, then to launch the app that I
want run.
Again, thanks to all 6 of you who replied.
Path: ucivax!gateway
From: kent@Camex.COM (Kent Borg)
Subject: Unsigned Longs
Message-ID: <9008161823.AA25007@uunet.uu.net>
Newsgroups: fa.think-c
Lines: 26
Date: 16 Aug 90 18:22:58 GMT
I talked to someone at Think about this and they know about it, but I
suspect am not completely understanding the problem.
From the programmer's perspective it is simply a bug. Stuff a double
with a number bigger than 2^31. Now try to assign it to an unsigned
long. The value of the unsigned long will be wrong (I think I
remember that it ends up being 2^31 -1). The unsigned long is capable
of holding the number, but the type conversion isn't.
The explanation from Think is that the 68881 does it that way, and
that to do it by hand would be too slow. Looking at a data book it
does look like the 68881 does not know about unsigned longs, but the
680X0 does.
I don't understand. Doesn't the compiler know when the type is an
unsigned long? Shouldn't it do whatever it takes to convert the type
and get the right answer, even if it takes a lot longer than getting
the wrong answer?
Am I getting something wrong, would this somehow slow down all longs?
--
Kent Borg internet: kent@camex.com MacNet: kentborg AOL: kent borg
H:(617) 776-6899 W:(617) 426-3577
"Congress was about to scuttle our defense department ... Could our military
industrial complex be backing Iraq?" - my mother, 8-4-90
Path: ucivax!gateway
From: bosborne@gn.ecn.purdue.edu (Bradley A Osborne)
Subject: Launch Code.
Message-ID: <9008190331.AA01680@gn.ecn.purdue.edu>
Newsgroups: fa.think-c
Lines: 8
Date: 19 Aug 90 07:06:48 GMT
I am having a good deal of trouble getting the _Launch trap to work from Think
C. I have been using the code straight fron 126, but it is not working:
I get a sysbeep and then my app terminates. Some people volunteered help
a few days back in response to an earlier request, but I have lost (erased)
the names. Could someone help?
Thanks.
Path: ucivax!gateway
From: jenlan@eos.arc.nasa.GOV (Jennifer S Lanham)
Subject: (none)
Message-ID: <9008271724.AA25256@eos.arc.nasa.gov>
Newsgroups: fa.think-c
Lines: 11
Date: 27 Aug 90 17:22:14 GMT
I am using the stdio routines in a progrsm, so I #include the header
file. Well, the link error I get is "_file is undefined". Looking at
the header file, it appears as an external( extern FILE _file[_NFILE] )
I have the actual ANSI library in the project, so what's the deal?
Anyone have a clue?
Thanks,
Jennifer S. Lanham
jenlan@eos.arc.nasa.gov
Path: ucivax!gateway
From: jenlan@eos.arc.nasa.GOV (Jennifer S Lanham)
Subject: (none)
Message-ID: <9008272356.AA01586@eos.arc.nasa.gov>
Newsgroups: fa.think-c
Lines: 33
Date: 27 Aug 90 23:58:30 GMT
My previous message was not specific enough it seems, PLUS
i found a very strange way around my problem. Here's the
form of a file in a project:
/**Comments about contents of file here (about 30 lines of comments*/
/** */
#include <stdio.h>
#include <color.h>
/*more includes and some defines here*/
/*the functions here */
InterpolateData(theData)
Ptr *theData;
{ /*the code here including the use of stderr*/
}
Now the code compiles fine, but a link error saying that
"_file is not defined" comes up. This variable, _file, is
used only in stdio.h. There it is defined as
external FILE _file[_NFILE].
I found that when I removed then re-added the my file which
brought up the link error, the link error disappeared.
Can anyone explain this behavior?
(It is not critical now, because I hacked my way out
of the link error, but STILL, why did it happen?
Thanx,
Jennifer S. Lanham
jenlan@eos.arc.nasa.gov
Path: ucivax!gateway
From: schabtac@stout.atd.ucar.edu (Adam Schabtach)
Subject: link error
Message-ID: <9008281514.AA15310@stout.atd.ucar.EDU>
Newsgroups: fa.think-c
Lines: 19
Date: 28 Aug 90 15:18:11 GMT
> From: Jennifer S Lanham <jenlan@eos.arc.nasa.GOV>
> I found that when I removed then re-added the my file which
> brought up the link error, the link error disappeared.
>
> Can anyone explain this behavior?
Well, I can't explain why, but I have seen similar things happen.
Sometimes, particularly after a nasty execution crash, the project
file can become corrupted. Removing and re-Adding one or more files
usually fixes this, but there has been a time or two I've had to trash
the project file and create a new one.
You *are* using version 4.0.2, right?
--Adam
Path: ucivax!gateway
From: nagel@wintermute.ICS.UCI.EDU (Mark Nagel)
Subject: ARCHIVE: CTalk class
Message-ID: <8814.651951848@wintermute.ics.uci.edu>
Newsgroups: fa.think-c
Reply-To: nagel@ICS.UCI.EDU
Organization: University of California, Irvine - Dept of ICS
Lines: 41
Date: 29 Aug 90 17:47:40 GMT
Phone: (714) 856-5039
[I apologize for the cut lines in this message -- this is how it
came and the sender has not yet sent me an uncorrupted copy -- mn]
/*****************************************************************************/
Date: Tue, 14 Aug 90 10:56:09 SET
From: Dmitri <LINDEA%CERNVM@pucc.princeton.EDU>
Subject: Posting
Hi! Here is a file that might find a good place in ics.uci.edu.
------------------------------------------------------------------------------
Ctalk is a class for use with THINK C 4.0x. It provides access
to speech on
Original version of MacinTalk access for THINK C is by Peter
Kaplan. I'd li
if(speechFlag=TRUE) {do talking}
should be
if(speeachFlag==TRUE) {do talking}
Besides CTalk is a class. ( if you don't like that then just
remove class de
Methods are easy to learn and are documented in the file
CTalk.c. Sample pro
Note: CTalk is distributed as CreditWare. If you are using it then
give me a li
Enjoy
Dmitri <dmitri@bolvan.ph.utexas.edu>
/*****************************************************************************/
[saved as: /mac/think-c/classes/ctalk.hqx]
Mark Nagel
Path: ucivax!gateway
From: fri0@midway.uchicago.edu ("Christian E. Fritze")
Subject: MultiFinder and the SoundMgr problem
Message-ID: <9008291838.AA27970@midway.uchicago.edu>
Newsgroups: fa.think-c
Lines: 31
Date: 29 Aug 90 18:48:54 GMT
I have written an application using the Think C Class
Library which reads a DNA sequence via digitized voice
and the Sound Mgr. Because I only need a few sampled
sounds and I want speed, the SndChannel remains open
while I send in successive bufferCmds. I should also note
that I pass a CallBackCmd after each bufferCmd which
resets a global Boolean variable to indicate that the
sound has finished. When the bit of sequence has been
read, the Channel is closed. I've tried to protect
against problems under MultiFinder by overriding the
Suspend method in my CDocument-type class to close the
SndChannel if one is open (then Resume opens it again on
return).
Of course, knowing as little as I do about MF, this
hasn't turned out to be enough. The program still crashes
if I choose a DA or other application while speaking is
in progress (the Channel is open). The crash generally
occurs upon return to my application.
Any hints? I am so inexperienced with MF considerations
that I'm not sure how to begin (I have the docs). If
anyone recognizes likely culprits in my scheme, I'd
appreciate some E-mail. No flames if you find this too
trivial (or stupid) a mistake. Just trying to learn.
Many thanks.
Chris
fri0@midway.uchicago.edu